<!--
 * @Description:
 * @Author: lz
 * @Date: 2022-12-28 21:10:13
 * @LastEditTime: 2022-12-30 21:22:51
 * @LastEditors: lz
-->
<template>
  <div class="config-wrap">
    <div style="margin-bottom: 20px;display: flex;align-items: center">
      <el-button type="primary" @click="dialogVisible = true">
        协助配置
        <i class="el-icon-arrow-right el-icon--right"></i>
      </el-button>

      <el-button type="primary" @click="toConfigure()">
        报批计划配置
        <i class="el-icon-arrow-right el-icon--right"></i>
      </el-button>
      <el-button type="primary" @click="submit()">确认</el-button>
    </div>
    <ConfigPage ref="ConfigPageRef" />
    <!-- <div class="footer">
      
    </div> -->
    <Window-staff :dialogVisible.sync="dialogVisible" @makeSure="makeSure" />
  </div>
</template>

<script>
import { assistDisposeApi } from "@/api/processApi.js";
import WindowStaff from "@/components/WindowStaff/index.vue";
import ConfigPage from "@/components/ConfigItem/config-page";
export default {
  components: {
    WindowStaff,
    ConfigPage
  },
  props: {
    projectId: {
      type: String,
      default: ""
    },
    processId: {
      type: String,
      default: ""
    },
    stage: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      detailId: null,
      selectValue: "",
      options: [],
      dialogVisible: false,
      windowId: "",
      tabStage: "1"
    };
  },
  created() {},
  methods: {
    toConfigure() {
      this.$router.push({
        path: "/configure/batch",
        query: {
          id: this.$route.query.id
        }
      });
    },
    makeSure(id) {
      this.windowId = id;
      this.assistDispose();
    },
    handleClick(tab) {
      this.tabStage = tab.name;
      this.$emit("updateStage", this.tabStage - 0);
    },
    assistDispose() {
      assistDisposeApi({
        windowId: this.windowId,
        projectId: this.projectId,
        stage: this.stage,
        id: this.processId
      }).then(res => {
        if (res.code == 0) {
          this.dialogVisible = false;
          this.$message.success(res.msg);
        }
      });
    },
    submit() {
      this.$refs.ConfigPageRef.$refs.canvasRef.save();
    },
    onClose() {}
  }
};
</script>
<style lang="scss" scoped>
.config-wrap {
  background: #ffffff;
  box-shadow: 0px 6px 58px 0px rgba(196, 203, 214, 0.1);
  border-radius: 24px;
  padding: 35px 75px;
  .select-label {
    font-size: 20px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #333333;
    margin-right: 20px;
  }
  .left-col {
    width: 179px;
  }
  .footer {
    text-align: center;
    margin-top: 81px;
  }
}
::v-deep .el-input__inner {
  height: 40px !important;
  border: 1px solid #cfcfcf;
  border-radius: 5px;
  font-size: 20px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #333333;
}
</style>
